home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / gcl-1.000 / gcl-1 / gcl-1.0 / add-defs < prev    next >
Encoding:
Text File  |  1994-05-09  |  1.5 KB  |  67 lines

  1. #!/bin/sh
  2.  
  3. if [ $# -le 0 ]  ; then echo usage: Provide a machine name as arg ; exit 1 ; fi
  4.  
  5. if [ -f h/$1.defs ] ; then echo using $1.defs ;
  6.   else echo h/$1.defs does not exist
  7.   echo Build one or use one of `ls h/*.defs`
  8.   exit 1
  9. fi
  10.  
  11. echo $1 > machine
  12.  
  13.  
  14. if [ $# -ge 2 ] ; then
  15.    if [ -f $2/c/sfasl.c ] ; then true ; else echo $2 is not the main akcl direct\
  16. ory  ; exit 1; fi ;fi
  17.  
  18.  
  19.   rm -f makedefs
  20.   echo > makedefs
  21.   echo "# begin makedefs" >> makedefs
  22.   if [ -d ${PWD}/unixport ] ; 
  23.    then  echo "GCLDIR=${PWD}" >> makedefs ;
  24.    else echo "GCLDIR=`pwd`" >> makedefs ;
  25.   fi
  26.   echo "SHELL=/bin/sh" >> makedefs
  27.   echo "MACHINE=$1"  >> makedefs
  28.   cat h/$1.defs >> makedefs 
  29.   echo "# end makedefs" >> makedefs
  30.  
  31.   echo inserting h/$1.defs in ..
  32.   for v in  mp/makefile makefile o/makefile lsp/makefile unixport/makefile  cmpnew/makefile  unixport/make_kcn  bin/makefile;
  33.   do
  34.   echo " $v,"
  35.   xbin/file-sub makedefs $v "# begin makedefs" "# end makedefs"
  36.   mv tmpx $v
  37.   done
  38.  
  39.  
  40. echo ""
  41.  
  42. # Copy the config.h over.
  43.  
  44. if [ -f h/config.h ]; then
  45. ./xbin/move-if-changed h/$1.h h/config.h
  46. else
  47. ln h/$1.h h/config.h
  48. fi
  49.  
  50. # fix the cmpinclude.h
  51.  
  52. if fgrep "Begin for cmpinclud" h/$1.h > /dev/null ;
  53. then
  54. ./xbin/file-sub h/$1.h h/cmpinclude.h "Begin for cmpinclud" "End for cmpinclud"
  55. else
  56. echo "/* Begin for cmpinclude */" >tmp.h
  57. echo "/* End for cmpinclude */" >>tmp.h
  58. ./xbin/file-sub tmp.h h/cmpinclude.h "Begin for cmpinclud" "End for cmpinclud"
  59. rm -f tmp.h
  60. fi
  61. ./xbin/move-if-changed tmpx h/cmpinclude.h
  62. rm -f tmpx
  63.  
  64. if [ -f xbin/$1-fix ] ; then xbin/$1-fix ; fi
  65.  
  66.  
  67.